<div class="tableform">
<div class="widgetconfig">
<table cellspacing="0" cellpadding="0" border="0" width="100%">
  <tbody><tr>
    <th><{t app='b2c'}>广告尺寸：<{/t}></th>
    <td><{t app='b2c'}>宽<{/t}>
  <input type="text" vtype="digits" required="true" class='x-input' autocomplete='off'  name="ad_pic_width" value="<{$setting.ad_pic_width}>" style="width:40px">px <{t app='b2c'}>高<{/t}><input type="text" vtype="digits" required="true" class='x-input' autocomplete='off' name="ad_pic_height" style="width:40px" value="<{$setting.ad_pic_height|default:90}>">px
	</td>
  </tr>
  <tr>
    <th><{t app='b2c'}>图片：<{/t}></th>
    <td>
	<input type=hidden name="ad_pic" value="<{$setting.ad_pic}>"><input name='ad_pic' class="imgsrc x-input " vtype="img_url" required='true' id="ad_pic" value="<{$setting.ad_pic}>"><input type=button value="<{t app='b2c'}>上传图片<{/t}>" class="uploadbtn" onclick="addPic()">
	</td>
  </tr>
   <tr>
    <th><{t app='b2c'}>图片描述：<{/t}></th>
    <td><input type="text" class='x-input' autocomplete='off'  name="ad_pic_txt" value="<{$setting.ad_pic_txt}>"></td>
  </tr>
  <tr>
    <th><{t app='b2c'}>图片链接：<{/t}></th>
    <td><input type="text" class='x-input ' vtype="purl" autocomplete='off'  name="ad_pic_link" value="<{$setting.ad_pic_link}>">
    </td>
  </tr>
   <tr>
    <th><{t app='b2c'}>链接类型：<{/t}></th>
    <td>
    <label><input type="radio" name="link_type" <{ if $setting.link_type=='default'||empty($setting.link_type)}>checked<{/if}> value="default">&nbsp;默认</label>
    <label><input type="radio" name="link_type" <{ if $setting.link_type=='map'}>checked<{/if}> value="map">&nbsp;图片热区域</label>
    </td>
  </tr>
  <tr id='link_map' <{ if $setting.link_type=='default'||empty($setting.link_type)}>style="display:none;"<{/if}>>
    <th><{t app='b2c'}>区域链接：<{/t}></th>
    <td><{input required=true type='select' name="area_type" options=array('rect'=>'矩形','circle'=>'圆形','poly'=>'多边形') value=$setting.area_type|default:'rect'}>
    范围：<input type="text" class='x-input' autocomplete='off'  name="link_area" value="<{$setting.link_area}>">&nbsp;&nbsp;
    <{help}>
       说明：坐标点以“,”分割，多组使用“|”线分割<br>矩形：请标注左上坐标和右下坐标点(x1,y1,x2,y2)。<br>&nbsp;&nbsp;&nbsp;&nbsp;例：(0,0,100,100) 左上(0,0)右下(100,100)
       圆形：请标注中心坐标和半径。(x1,y1,r)<br>&nbsp;&nbsp;&nbsp;&nbsp;例：(100,100,50) 中心点(100,100)半径50px
       多边形：设置多边形各个点的坐标。(x1,y1,x2,y2,x3,y3,....)<br>&nbsp;&nbsp;&nbsp;&nbsp;例：0,0,30,0,0,30 第1个点(0,0)，第2个点(30,0)，第3个点(0,30)

    <{/help}>
    </td>
  </tr>
</tbody></table>
</div>
</div>
<script>
(function(){
    $$('input[type=radio]').each(function(el){
    el.addEvent('click',function(e){
          if(this.checked==true){
             $('link_map').setStyle('display',this.value=='map'?'':'none');
          }
        });
    });
})();
	function addPic(){
			var url='btools-alertpages.html?dd='+Date.now()+'&goto='+encodeURIComponent("btools-image_broswer.html?type=big");
			Ex_Loader('modedialog',function(){
			return new imgDialog(url,{onCallback:function(image_id,image_src){
					 $('ad_pic').value=image_src;
			}})	;
			});
		}
</script>